Move OpenCode/Pi plugin install into code-trace setup - #13
Closed
winjer wants to merge 1 commit into
Closed
Conversation
Final slice of the installer migration: agent plugin/extension install moves from install.sh into the binary as `code-trace setup --install-opencode | --offer-opencode | --install-pi | --offer-pi`. - src/setup.rs embeds the plugin sources with include_str!, so install works under curl | bash — where there is no local checkout to copy from and the old shell path silently skipped. Detection, the y/N prompt (read from /dev/tty in-process, so it can't consume the piped script), and the write are all in Rust and unit-tested. - install.sh shrinks from 365 to 173 lines: the plugin-source resolution, copy helpers, agent detection, the TTY_IN/resolve_tty_in machinery, and the remaining bash prompts are all gone. It is now a bootstrap (detect platform, download binary, PATH) that hands off to `code-trace setup` for every configuration step. - Tests: 5 new unit tests (embedded sources, plugin paths, detection, install write) + 4 integration tests driving the real binary (install writes the embedded source; offer skips when not detected). Verified end to end through a piped curl | bash simulation with OpenCode present: the plugin is offered, installed from the embedded source, and the email prompt still works — all in one run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 20, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #12 (which is stacked on #11). Merge order: #11 → #12 → this. GitHub retargets each to
mainas its base merges.Final slice of the installer migration: agent plugin/extension install moves out of
install.shinto the binary.What changed
src/setup.rsembeds the plugin sources withinclude_str!, so plugin install now works undercurl | bash— where there's no local checkout to copy from and the old shell path silently skipped ("Plugin source not found"). New flags:--install-opencode,--offer-opencode,--install-pi,--offer-pi. Detection, the y/N prompt (read from/dev/ttyin-process, so it can't consume the piped script), and the write are all Rust and unit-tested.install.shshrinks from 365 → 173 lines. Gone: plugin-source resolution, the copy helpers, agent detection, theTTY_IN/resolve_tty_inmachinery, and the last bashreadprompts. It's now a bootstrap — detect platform, download binary, set PATH — that hands off tocode-trace setupfor every configuration step.Verification
cargo test(108 lib incl. 29 setup + 16 integration) andcargo clippy --all-targetsclean.curl | bashsimulation with OpenCode present: the plugin is offered, installed from the embedded source, and the email prompt still works — all in one run.Where this leaves
install.shIt's now a thin bootstrap. Every fragile, growing piece — JSON hook editing, config writing, prompts, plugin install — lives in the tested binary.
python3is gone; no interpreter is required. The three prompt/readbugs we chased earlier can't recur, because prompts run in a separate process reading/dev/ttyrather than in a shell reading the piped script.🤖 Generated with Claude Code